package com.puti.doctor.service.impl;

import java.util.List;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.puti.doctor.domain.vo.BillVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.puti.doctor.mapper.DoctorBillMapper;
import com.puti.doctor.domain.DoctorBill;
import com.puti.doctor.service.IDoctorBillService;

/**
 * 医生-流水 医生-流水Service业务层处理
 * 
 * @author puti
 * @date 2021-04-22
 */
@Service
public class DoctorBillServiceImpl implements IDoctorBillService 
{
    @Autowired
    private DoctorBillMapper doctorBillMapper;

    /**
     * 查询医生-流水 医生-流水
     * 
     * @param billId 医生-流水 医生-流水ID
     * @return 医生-流水 医生-流水
     */
    @Override
    public DoctorBill selectDoctorBillById(String billId)
    {
        return doctorBillMapper.selectDoctorBillById(billId);
    }

    /**
     * 查询医生-流水 医生-流水列表
     * 
     * @param doctorBill 医生-流水 医生-流水
     * @return 医生-流水 医生-流水
     */
    @Override
    public List<DoctorBill> selectDoctorBillList(DoctorBill doctorBill)
    {
        return doctorBillMapper.selectDoctorBillList(doctorBill);
    }

    /**
     * 新增医生-流水 医生-流水
     * 
     * @param doctorBill 医生-流水 医生-流水
     * @return 结果
     */
    @Override
    public int insertDoctorBill(DoctorBill doctorBill)
    {
        return doctorBillMapper.insertDoctorBill(doctorBill);
    }

    /**
     * 修改医生-流水 医生-流水
     * 
     * @param doctorBill 医生-流水 医生-流水
     * @return 结果
     */
    @Override
    public int updateDoctorBill(DoctorBill doctorBill)
    {
        return doctorBillMapper.updateDoctorBill(doctorBill);
    }

    /**
     * 批量删除医生-流水 医生-流水
     * 
     * @param billIds 需要删除的医生-流水 医生-流水ID
     * @return 结果
     */
    @Override
    public int deleteDoctorBillByIds(String[] billIds)
    {
        return doctorBillMapper.deleteDoctorBillByIds(billIds);
    }

    /**
     * 删除医生-流水 医生-流水信息
     * 
     * @param billId 医生-流水 医生-流水ID
     * @return 结果
     */
    @Override
    public int deleteDoctorBillById(String billId)
    {
        return doctorBillMapper.deleteDoctorBillById(billId);
    }

    @Override
    public Page findDoctorId(Long doctorId,int judge,String startTime,String endTime, int page, int pageSize) {
        PageHelper.startPage(page,pageSize);
        Page pages = (Page) doctorBillMapper.findDoctorId(doctorId,judge,startTime,endTime);
        return pages;
    }

    @Override
    public List<BillVo> findByDoctorId(Long doctorId) {
        return doctorBillMapper.findByDoctorId(doctorId);
    }
}
